(********************************************************************** :Program. StringOps.def :Contents. string operations, replaces the standard module "Strings". :Author. Nicolas Benezan [bne] :Address. Postwiesenstr. 2, D7000 Stuttgart 60 :Phone. 711/333679 :Copyright. Public Domain :Language. Modula-2 :Translator. M2Amiga A+L V3.2d :History. V1.0c [bne] 18.Apr.1989 **********************************************************************) DEFINITION MODULE StringOps; (* All procedures will truncate the string if it was too long to fit into the array boundaries. *) PROCEDURE Append(VAR String:ARRAY OF CHAR; Tail:ARRAY OF CHAR); (*:Semantic. Appends to *) PROCEDURE AppendChar(VAR String:ARRAY OF CHAR; Char:CHAR); (*:Semantic. Appends a single character to *) PROCEDURE Assign( Source:ARRAY OF CHAR; VAR Destination:ARRAY OF CHAR); (*:Semantic. Copies to . *) PROCEDURE CapChar(VAR Char:CHAR); (*:Semantic. Returns the capital letter of :Note. works also with foreign letters (äöüßáè...) *) PROCEDURE CapString(VAR String:ARRAY OF CHAR); (*:Semantic. CapChar()s each character of *) PROCEDURE FindChar(String:ARRAY OF CHAR; Char:CHAR; Start:INTEGER):INTEGER; (*:Semantic. Searches next occurence of in :Input. Start: position where to start searching :Result. position of in :Result. or -1 if is not found *) PROCEDURE Compare(String1,String2:ARRAY OF CHAR):INTEGER; (*:Semantic. Compares vs :Result. 0 if they are equal :Result. <0 if String1 < String2 :Result. >0 if String1 > String2 *) PROCEDURE Concat( Head:ARRAY OF CHAR; Tail:ARRAY OF CHAR; VAR String:ARRAY OF CHAR); (*:Semantic. concatenates and to *) PROCEDURE DeleteSubString(VAR String:ARRAY OF CHAR; Start,Len:INTEGER); (*:Semantic. Deletes a substring of which starts :Semantic. at position and is characters :Semantic. long. *) PROCEDURE FindSubString(String:ARRAY OF CHAR; SubString:ARRAY OF CHAR; Start:INTEGER):INTEGER; (*:Semantic. Searches next occurence of in :Input. Start: position where to start searching :Result. next position of in :Result. or -1 if not found *) PROCEDURE InsertSubString(VAR String:ARRAY OF CHAR; SubString:ARRAY OF CHAR; Position:INTEGER); (*:Semantic. Inserts into at *) PROCEDURE InsertChar(VAR String:ARRAY OF CHAR; Char:CHAR; Position:INTEGER); (*:Semantic. Inserts a single character into at *) PROCEDURE Length(String:ARRAY OF CHAR):INTEGER; (*:Result. Length of *) PROCEDURE OverWrite(VAR String:ARRAY OF CHAR; Overlay:ARRAY OF CHAR; Position:INTEGER); (*:Semantic. Replaces (overwrites) the caracters of with :Semantic. starting at . *) PROCEDURE SubString( Source:ARRAY OF CHAR; VAR Destination:ARRAY OF CHAR; Position,Len:INTEGER); (*:Output. Destination: the substring of which starts :Semantic. at position and is characters long. *) END StringOps.